package com.huiyujiaoyu.widget;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.huiyujiaoyu.powertime.R;


public class Remind2Dialog extends Dialog implements View.OnClickListener {

    private int resd;
    private String content;
    private TextView tv_remindOne;
    private ImageView iv_closed;
    /**
     *
     * @param context
     * @param content
     * @param theme
     */
    public Remind2Dialog(Context context, int resd, String content,int theme) {
        super(context, theme);
        this.resd = resd;
        this.content = content;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.dialog_remind2);
        this.setCanceledOnTouchOutside(true);
        tv_remindOne = (TextView) findViewById(R.id.tv_remindOne);
        iv_closed = (ImageView) findViewById(R.id.iv_closed);
        iv_closed.setOnClickListener(this);
        setTopImg();
        tv_remindOne.setText(content);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_closed:
                    dismiss();
                break;
            default:
                break;
        }
    }
    public void setTopImg() {
        if (tv_remindOne != null)
            tv_remindOne.setCompoundDrawablesWithIntrinsicBounds(0, resd, 0, 0);
    }
}
